/*
 * Copyright (c) 2006, 2021, webrx.cn All rights reserved.
 *
 */
package cn.webrx;

import java.io.UnsupportedEncodingException;

/**
 * <p>Project: javaseapp - Str1
 * <p>Powered by webrx On 2021-08-06 10:36:52
 * <p>Created by IntelliJ IDEA
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 16
 */
public class Str3 {
    public static void main(String[] args) throws UnsupportedEncodingException {
        String[] ss = new String[]{};
        //.length 数组的属性
        int size = ss.length;
        System.out.println(size);//0

        String s = "hello-中国人";
        //length() String的方法
        int len = s.length();//9字符个数
        System.out.println(len);

        int bytesize = s.getBytes().length;
        System.out.println(bytesize);//15 (每个汉字3个字节)

        String s1 = "ok";
        String s2 = "ok";
        if (s1.equals(s2)) {
            System.out.printf("s1=%s,s2=%s,相等", s1, s2);
        }
    }
}
